<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get current Tidy configuration</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="tidy.props.errorbuffer.html">« tidy::$errorBuffer</a></li>
      <li style="float: right;"><a href="tidy.gethtmlver.html">tidy::getHtmlVer »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.tidy.html">tidy</a></li>
    <li>Get current Tidy configuration</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="tidy.getconfig" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">tidy::getConfig</h1>
  <h1 class="refname">tidy_get_config</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8, PECL tidy &gt;= 0.7.0)</p><p class="refpurpose"><span class="refname">tidy::getConfig</span> -- <span class="refname">tidy_get_config</span> &mdash; <span class="dc-title">Get current Tidy configuration</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-tidy.getconfig-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>tidy::getConfig</strong></span>(): <span class="type">array</span></div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>tidy_get_config</strong></span>(<span class="methodparam"><span class="type"><a href="class.tidy.html" class="type tidy">tidy</a></span> <code class="parameter">$tidy</code></span>): <span class="type">array</span></div>

  <p class="para rdfs-comment">
   Gets the list of the configuration options in use by the given tidy
   <code class="parameter">tidy</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-tidy.getconfig-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">tidy</code></dt>

     <dd>

      <p class="para">
       The <span class="classname"><a href="class.tidy.html" class="classname">Tidy</a></span> 对象。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-tidy.getconfig-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an array of configuration options.
  </p>
  <p class="para">
   For an explanation about each option, visit <a href="http://api.html-tidy.org/#quick-reference" class="link external">&raquo;&nbsp;http://api.html-tidy.org/#quick-reference</a>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-tidy.getconfig-examples">
  <h3 class="title">范例</h3>  
  <p class="para">
   <div class="example" id="example-3798">
    <p><strong>示例 #1 <span class="function"><strong>tidy::getConfig()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$html&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'&lt;p&gt;test&lt;/p&gt;'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$config&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'indent'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'output-xhtml'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'wrap'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">200</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$tidy&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">tidy_parse_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$html</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getConfig</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [indent-spaces] =&gt; 2
    [wrap] =&gt; 200
    [tab-size] =&gt; 8
    [char-encoding] =&gt; 1
    [input-encoding] =&gt; 3
    [output-encoding] =&gt; 1
    [newline] =&gt; 1
    [doctype-mode] =&gt; 1
    [doctype] =&gt;
    [repeated-attributes] =&gt; 1
    [alt-text] =&gt;
    [slide-style] =&gt;
    [error-file] =&gt;
    [output-file] =&gt;
    [write-back] =&gt;
    [markup] =&gt; 1
    [show-warnings] =&gt; 1
    [quiet] =&gt;
    [indent] =&gt; 1
    [hide-endtags] =&gt;
    [input-xml] =&gt;
    [output-xml] =&gt; 1
    [output-xhtml] =&gt; 1
    [output-html] =&gt;
    [add-xml-decl] =&gt;
    [uppercase-tags] =&gt;
    [uppercase-attributes] =&gt;
    [bare] =&gt;
    [clean] =&gt;
    [logical-emphasis] =&gt;
    [drop-proprietary-attributes] =&gt;
    [drop-font-tags] =&gt;
    [drop-empty-paras] =&gt; 1
    [fix-bad-comments] =&gt; 1
    [break-before-br] =&gt;
    [split] =&gt;
    [numeric-entities] =&gt;
    [quote-marks] =&gt;
    [quote-nbsp] =&gt; 1
    [quote-ampersand] =&gt; 1
    [wrap-attributes] =&gt;
    [wrap-script-literals] =&gt;
    [wrap-sections] =&gt; 1
    [wrap-asp] =&gt; 1
    [wrap-jste] =&gt; 1
    [wrap-php] =&gt; 1
    [fix-backslash] =&gt; 1
    [indent-attributes] =&gt;
    [assume-xml-procins] =&gt;
    [add-xml-space] =&gt;
    [enclose-text] =&gt;
    [enclose-block-text] =&gt;
    [keep-time] =&gt;
    [word-2000] =&gt;
    [tidy-mark] =&gt;
    [gnu-emacs] =&gt;
    [gnu-emacs-file] =&gt;
    [literal-attributes] =&gt;
    [show-body-only] =&gt;
    [fix-uri] =&gt; 1
    [lower-literals] =&gt; 1
    [hide-comments] =&gt;
    [indent-cdata] =&gt;
    [force-output] =&gt; 1
    [show-errors] =&gt; 6
    [ascii-chars] =&gt; 1
    [join-classes] =&gt;
    [join-styles] =&gt; 1
    [escape-cdata] =&gt;
    [language] =&gt;
    [ncr] =&gt; 1
    [output-bom] =&gt; 2
    [replace-color] =&gt;
    [css-prefix] =&gt;
    [new-inline-tags] =&gt;
    [new-blocklevel-tags] =&gt;
    [new-empty-tags] =&gt;
    [new-pre-tags] =&gt;
    [accessibility-check] =&gt; 0
    [vertical-space] =&gt;
    [punctuation-wrap] =&gt;
    [merge-divs] =&gt; 1
)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-tidy.getconfig-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><strong>tidy_reset_config()</strong></span></li>
   <li class="member"><span class="function"><strong>tidy_save_config()</strong></span></li>
  </ul>
 </div>


</div></div></div></body></html>